<!doctype html>
<html lang="en" ng-app>
<head>
    <title>Push notification demo</title>

    <meta charset="utf-8">

    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet"
          href="/bootstrap/css/bootstrap.min.css">

    <!-- Latest compiled and minified JavaScript -->
    <script src="/bootstrap/js/bootstrap.min.js"></script>

    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js"></script>

    <script src="js/installations.js"></script>

    <style>
        td {
            word-wrap: break-word;
        }
    </style>

</head>

<body ng-controller="InstallationsController">
<h1>Application Device Installations</h1>


<div class="container-fluid">

    <div class="span12">
        <!--Sidebar content-->

        Search: <input ng-model="query">

    </div>
    <p/>

    <div class="row-fluid span12">
        <table class="table table-striped" style="table-layout: fixed">
            <thead>
            <tr>
                <th>Registration Id</th>
                <th>Application Id</th>
                <th>User Id</th>
                <th>Device Token</th>
                <th>Device Type</th>
                <th>Time Zone</th>
                <th>Subscriptions</th>
                <!--
                <th>Status</th>
                -->
                <th>Action</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="device in devices | filter:query">
                <td>{{device.id}}</td>
                <td>{{device.appId}}</td>
                <td>{{device.userId}}</td>
                <td>{{device.deviceToken}}</td>
                <td>{{device.deviceType}}</td>
                <td>{{device.timeZone}}</td>
                <td>{{device.subscriptions}}</td>
                <!--
                <td>{{device.status}}</td>
                -->
                <td>
                    <button type="button" class="btn btn-default btn-sm"
                            ng-click="notify(device.id, 'Hello')"
                            title="Send a notification to the device"
                            >
                        <span class="glyphicon glyphicon-send"></span>
                    </button>

                    <button type="button" class="btn btn-default btn-sm"
                            ng-click="delete($index, device.id)"
                            title="Remove the installation record"
                            >
                        <span class="glyphicon glyphicon-remove"></span>
                    </button>
                </td>
            </tr>
            <tr>
                <td>{{status}}</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>

<a class="btn btn-default btn-lg" href="/app-list.html">List client applications</a>

</body>
</html>
